package com.lkd.controller;

import com.lkd.utils.AliOssUtil;
import com.lkd.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @author yan
 * @version 1.0
 * Create by 2024-8-19 17:21
 */
@RestController
public class UploadController {

    @Autowired
    private AliOssUtil aliOssUtil;

    @PostMapping("/api/vm-service/sku/fileUpload")
    public Result upload (MultipartFile fileName) throws Exception {
        String upload = aliOssUtil.upload (fileName);
        System.out.println (upload);
        return Result.success (upload);
    }

}
